<template>
  <InyaaHeader />
  <section id="main-container">
    <InyaaCover />
    <div id="page" class="site wrapper">
      <router-view />
    </div>
    <InyaaFooter v-model:config="configVo"/>
  </section>
</template>
<script lang="ts">
import InyaaHeader from './components/InyaaHeader.vue';
import InyaaFooter from './components/InyaaFooter.vue';
import InyaaCover from "./components/InyaaCover.vue";
import {defineComponent, onMounted, ref} from 'vue';
import {fileGet, getConfig} from "./api/sys";
import {ConfigItem} from "./api/modules/sys";

export default defineComponent({
  components: {
    InyaaCover,
    InyaaHeader,
    InyaaFooter
  },
  props: ['config'],
  setup() {
    const getImage = async () => {
      const url = await fileGet(1)
      document.getElementById('inyaaBody').style.backgroundImage = "url(" + url + ")";
    }

    const configVo = ref<ConfigItem>({});

    const getConfigInfo = async () => {
      configVo.value = await getConfig(0)
    }

    onMounted(async () => {
      await getImage()
      await getConfigInfo()
    });

    return {
      configVo,
    };
  },
});
</script>
<style>
body {

}
</style>